	Declare @DBName varchar(50)	
	SET @DBName='APM'		
	
	IF Not Exists (Select 1 from master..sysdatabases where Name=@DBName)
	GOTO EXITSUB
---------------------------------------------------------------------------------------------------
-- Dropping  APM Database
---------------------------------------------------------------------------------------------------

	Execute('ALTER DATABASE '+@DBName+' SET SINGLE_USER  WITH ROLLBACK IMMEDIATE')
	Execute('Drop database '+@DBname)	
	Print 'Database Dropped Successfully'

EXITSUB:
	Print 'Database Not Found'
